package models

import (
	"social-app/dao"
	"time"
)

type DynamicCategory struct {
	Id         int       `json:"id"`
	Name       string    `json:"name"`
	CreateTime time.Time `json:"create_time" orm:"AutoCreateTime"`
	UpdateTime time.Time `json:"update_time" orm:"AutoUpdateTime"`
}

func (dc *DynamicCategory) TableName() string {
	return "dynamic_category"
}

func GetDynamicCategoryList() ([]DynamicCategory, error) {
	cates := make([]DynamicCategory, 0)
	err := dao.Db.Find(&cates).Error
	return cates, err
}
